<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>票链智联 - 修理厂端</title>
    <script src="https://cdn.tailwindcss.com/3.3.3"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', sans-serif;
            background-color: #f5f7fa;
            color: #2d3748;
        }
        .glassmorphism {
            background: rgba(255, 255, 255, 0.8);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
        }
        .chart-container {
            height: 280px;
            width: 100%;
            position: relative;
        }
        .tab-active {
            background-color: #3b82f6;
            color: white;
        }
        .tab-inactive {
            background-color: white;
            color: #3b82f6;
            border: 1px solid #3b82f6;
        }
        .notification-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background-color: #ef4444;
            color: white;
            font-size: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
    </style>
</head>
<body class="min-h-screen">
    <!-- 顶部导航 -->
    <nav class="bg-blue-600 text-white p-4 shadow-md">
        <div class="container mx-auto flex justify-between items-center">
            <div class="flex items-center">
                <i class="fas fa-tools text-xl mr-2"></i>
                <h1 class="text-xl font-bold">票链智联</h1>
            </div>
            <div class="flex items-center space-x-4">
                <div class="relative">
                    <i class="fas fa-bell text-xl"></i>
                    <div class="notification-badge">3</div>
                </div>
                <div class="w-8 h-8 rounded-full bg-blue-300 flex items-center justify-center">
                    <i class="fas fa-user"></i>
                </div>
            </div>
        </div>
    </nav>

    <!-- 主内容区 -->
    <div class="container mx-auto p-4">
        <!-- 功能选项卡 -->
        <div class="flex mb-6 overflow-x-auto">
            <button id="pendingTab" class="tab-active px-6 py-2 rounded-l-lg font-medium mr-1">待审批</button>
            <button id="statsTab" class="tab-inactive px-6 py-2 font-medium mr-1">数据看板</button>
            <button id="messagesTab" class="tab-inactive px-6 py-2 rounded-r-lg font-medium">消息通知</button>
        </div>

        <!-- 待审批列表 -->
        <div id="pendingSection" class="space-y-4">
            <div class="glassmorphism p-4 card-hover">
                <div class="flex justify-between items-center mb-2">
                    <span class="text-sm text-gray-500">案件号: PL20240520001</span>
                    <span class="text-sm text-gray-500">2024-05-20 09:30</span>
                </div>
                <h3 class="font-semibold text-lg mb-1">太平洋保险</h3>
                <div class="flex justify-between items-center">
                    <span class="text-blue-600 font-bold">¥2,580.00</span>
                    <button class="bg-blue-600 text-white px-4 py-1 rounded-full text-sm">查看详情</button>
                </div>
            </div>

            <div class="glassmorphism p-4 card-hover">
                <div class="flex justify-between items-center mb-2">
                    <span class="text-sm text-gray-500">案件号: PL20240519002</span>
                    <span class="text-sm text-gray-500">2024-05-19 14:15</span>
                </div>
                <h3 class="font-semibold text-lg mb-1">平安保险</h3>
                <div class="flex justify-between items-center">
                    <span class="text-blue-600 font-bold">¥3,420.00</span>
                    <button class="bg-blue-600 text-white px-4 py-1 rounded-full text-sm">查看详情</button>
                </div>
            </div>

            <div class="glassmorphism p-4 card-hover">
                <div class="flex justify-between items-center mb-2">
                    <span class="text-sm text-gray-500">案件号: PL20240518003</span>
                    <span class="text-sm text-gray-500">2024-05-18 11:20</span>
                </div>
                <h3 class="font-semibold text-lg mb-1">人保财险</h3>
                <div class="flex justify-between items-center">
                    <span class="text-blue-600 font-bold">¥1,980.00</span>
                    <button class="bg-blue-600 text-white px-4 py-1 rounded-full text-sm">查看详情</button>
                </div>
            </div>
        </div>

        <!-- 数据看板 -->
        <div id="statsSection" class="hidden">
            <div class="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
                <div class="glassmorphism p-4 text-center">
                    <div class="text-gray-500 mb-1">待开票</div>
                    <div class="text-2xl font-bold text-blue-600">12</div>
                </div>
                <div class="glassmorphism p-4 text-center">
                    <div class="text-gray-500 mb-1">已开票</div>
                    <div class="text-2xl font-bold text-green-600">28</div>
                </div>
                <div class="glassmorphism p-4 text-center">
                    <div class="text-gray-500 mb-1">失败</div>
                    <div class="text-2xl font-bold text-red-600">3</div>
                </div>
            </div>

            <div class="glassmorphism p-4">
                <h3 class="font-semibold mb-4">开票趋势</h3>
                <div class="chart-container">
                    <canvas id="statsChart"></canvas>
                </div>
            </div>
        </div>

        <!-- 消息通知 -->
        <div id="messagesSection" class="hidden">
            <div class="glassmorphism p-4 card-hover mb-4">
                <div class="flex justify-between items-center mb-2">
                    <span class="text-sm text-gray-500">系统通知</span>
                    <span class="text-sm text-gray-500">2024-05-20 10:15</span>
                </div>
                <h3 class="font-semibold mb-1">案件PL20240520001已审批通过</h3>
                <p class="text-gray-600 text-sm">您的案件已通过审批，请及时查看并处理。</p>
            </div>

            <div class="glassmorphism p-4 card-hover mb-4">
                <div class="flex justify-between items-center mb-2">
                    <span class="text-sm text-gray-500">系统通知</span>
                    <span class="text-sm text-gray-500">2024-05-19 16:30</span>
                </div>
                <h3 class="font-semibold mb-1">新案件待审批</h3>
                <p class="text-gray-600 text-sm">您有新的案件PL20240519002待审批，请及时处理。</p>
            </div>

            <div class="glassmorphism p-4 card-hover">
                <div class="flex justify-between items-center mb-2">
                    <span class="text-sm text-gray-500">系统通知</span>
                    <span class="text-sm text-gray-500">2024-05-18 09:45</span>
                </div>
                <h3 class="font-semibold mb-1">系统维护通知</h3>
                <p class="text-gray-600 text-sm">系统将于5月20日凌晨2:00-4:00进行维护升级，请提前做好安排。</p>
            </div>
        </div>

        <!-- 案件详情页 -->
        <div id="caseDetailSection" class="hidden">
            <div class="glassmorphism p-4 mb-4">
                <div class="flex justify-between items-center mb-4">
                    <h2 class="text-xl font-bold">案件详情</h2>
                    <button id="backToList" class="text-blue-600">
                        <i class="fas fa-arrow-left mr-1"></i>返回
                    </button>
                </div>

                <div class="mb-6">
                    <div class="flex justify-between items-center mb-2">
                        <span class="text-sm text-gray-500">案件号: PL20240520001</span>
                        <span class="text-sm text-gray-500">2024-05-20 09:30</span>
                    </div>
                    <h3 class="font-semibold text-lg mb-1">太平洋保险</h3>
                    <div class="flex justify-between items-center">
                        <span class="text-blue-600 font-bold">¥2,580.00</span>
                        <span class="text-sm bg-blue-100 text-blue-800 px-2 py-1 rounded-full">待审批</span>
                    </div>
                </div>

                <div class="mb-6">
                    <h4 class="font-semibold mb-3">维修项目明细</h4>
                    <div class="space-y-3">
                        <div class="flex justify-between">
                            <span>前保险杠修复</span>
                            <span class="font-medium">¥680.00</span>
                        </div>
                        <div class="flex justify-between">
                            <span>右前大灯更换</span>
                            <span class="font-medium">¥1,200.00</span>
                        </div>
                        <div class="flex justify-between">
                            <span>喷漆工时</span>
                            <span class="font-medium">¥700.00</span>
                        </div>
                    </div>
                </div>

                <div class="flex space-x-4">
                    <button id="approveBtn" class="flex-1 bg-green-600 text-white py-2 rounded-lg">
                        <i class="fas fa-check-circle mr-1"></i>通过
                    </button>
                    <button id="rejectBtn" class="flex-1 bg-red-600 text-white py-2 rounded-lg">
                        <i class="fas fa-times-circle mr-1"></i>拒绝
                    </button>
                </div>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer class="bg-gray-100 py-4 mt-8">
        <div class="container mx-auto text-center text-gray-500 text-sm">
            <p>created by <a href="https://space.coze.cn" class="text-blue-600 hover:underline">coze space</a></p>
            <p>页面内容均由 AI 生成，仅供参考</p>
        </div>
    </footer>

    <script>
        // 切换选项卡
        document.getElementById('pendingTab').addEventListener('click', function() {
            document.getElementById('pendingSection').classList.remove('hidden');
            document.getElementById('statsSection').classList.add('hidden');
            document.getElementById('messagesSection').classList.add('hidden');
            document.getElementById('caseDetailSection').classList.add('hidden');
            
            this.classList.add('tab-active');
            this.classList.remove('tab-inactive');
            document.getElementById('statsTab').classList.remove('tab-active');
            document.getElementById('statsTab').classList.add('tab-inactive');
            document.getElementById('messagesTab').classList.remove('tab-active');
            document.getElementById('messagesTab').classList.add('tab-inactive');
        });

        document.getElementById('statsTab').addEventListener('click', function() {
            document.getElementById('pendingSection').classList.add('hidden');
            document.getElementById('statsSection').classList.remove('hidden');
            document.getElementById('messagesSection').classList.add('hidden');
            document.getElementById('caseDetailSection').classList.add('hidden');
            
            this.classList.add('tab-active');
            this.classList.remove('tab-inactive');
            document.getElementById('pendingTab').classList.remove('tab-active');
            document.getElementById('pendingTab').classList.add('tab-inactive');
            document.getElementById('messagesTab').classList.remove('tab-active');
            document.getElementById('messagesTab').classList.add('tab-inactive');
            
            // 初始化图表
            initStatsChart();
        });

        document.getElementById('messagesTab').addEventListener('click', function() {
            document.getElementById('pendingSection').classList.add('hidden');
            document.getElementById('statsSection').classList.add('hidden');
            document.getElementById('messagesSection').classList.remove('hidden');
            document.getElementById('caseDetailSection').classList.add('hidden');
            
            this.classList.add('tab-active');
            this.classList.remove('tab-inactive');
            document.getElementById('pendingTab').classList.remove('tab-active');
            document.getElementById('pendingTab').classList.add('tab-inactive');
            document.getElementById('statsTab').classList.remove('tab-active');
            document.getElementById('statsTab').classList.add('tab-inactive');
        });

        // 查看详情按钮
        document.querySelectorAll('#pendingSection button').forEach(button => {
            button.addEventListener('click', function() {
                document.getElementById('pendingSection').classList.add('hidden');
                document.getElementById('caseDetailSection').classList.remove('hidden');
            });
        });

        // 返回列表按钮
        document.getElementById('backToList').addEventListener('click', function() {
            document.getElementById('pendingSection').classList.remove('hidden');
            document.getElementById('caseDetailSection').classList.add('hidden');
        });

        // 审批按钮
        document.getElementById('approveBtn').addEventListener('click', function() {
            alert('案件已审批通过');
            document.getElementById('pendingSection').classList.remove('hidden');
            document.getElementById('caseDetailSection').classList.add('hidden');
        });

        document.getElementById('rejectBtn').addEventListener('click', function() {
            alert('案件已拒绝');
            document.getElementById('pendingSection').classList.remove('hidden');
            document.getElementById('caseDetailSection').classList.add('hidden');
        });

        // 初始化统计图表
        function initStatsChart() {
            const ctx = document.getElementById('statsChart').getContext('2d');
            new Chart(ctx, {
                type: 'line',
                data: {
                    labels: ['1月', '2月', '3月', '4月', '5月'],
                    datasets: [
                        {
                            label: '待开票',
                            data: [15, 12, 18, 14, 12],
                            borderColor: '#3b82f6',
                            backgroundColor: 'rgba(59, 130, 246, 0.1)',
                            tension: 0.3,
                            fill: true
                        },
                        {
                            label: '已开票',
                            data: [20, 22, 25, 28, 28],
                            borderColor: '#10b981',
                            backgroundColor: 'rgba(16, 185, 129, 0.1)',
                            tension: 0.3,
                            fill: true
                        },
                        {
                            label: '失败',
                            data: [2, 3, 1, 2, 3],
                            borderColor: '#ef4444',
                            backgroundColor: 'rgba(239, 68, 68, 0.1)',
                            tension: 0.3,
                            fill: true
                        }
                    ]
                },
                options: {
                    responsive: true,
                    maintainAspectRatio: false,
                    plugins: {
                        legend: {
                            position: 'top',
                        }
                    },
                    scales: {
                        y: {
                            beginAtZero: true
                        }
                    }
                }
            });
        }
    </script>
</body>
</html>